#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int cmp(const void* a, const void* b) {
    return *((int*)a) - *((int*)b);
}

int main() {
    int n;
    scanf("%d", &n);
    int num = n * 3;
    int* p = (int*)malloc(sizeof(int) * num);
    for (int i = 0; i < num; ++i) {
        scanf("%d", p + i);
    }

    qsort(p, num, 4, cmp);
    long long count = 0;
    for (int i = num - 2; n > 0; i -= 2, --n) {
        count += p[i];
    }

    printf("%ld\n", count);
    free(p);
    return 0;
}